# -*- coding:utf-8 -*- 
__date__ = '2022/6/26 9:18 下午'


class Solution(object):
  def missingNumber(self, nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    # 循环判断对应的下标是否在集合中
    for index in range(len(nums)+1):
      if index not in nums:
        return index

if __name__ == '__main__':
    Solution = Solution()
    nums = [3,0,1]
    res = Solution.missingNumber(nums)
    print(res)